

//
//  CookListViewCell.m
//  cookBook
//
//  Created by xalo on 16/1/23.
//  Copyright © 2016年 张广斌. All rights reserved.
//

#import "CookListViewCell.h"
#import "Model.h"
#import <UIImageView+WebCache.h>

@interface CookListViewCell ()
@property (strong, nonatomic) IBOutlet UIImageView *pictureView;

@property (strong, nonatomic) IBOutlet UILabel *title;

@property (strong, nonatomic) IBOutlet UILabel *yuanliao;

@end

@implementation CookListViewCell

// 赋值
- (void)setContentViewWithModel:(Model *)model
{
    self.title.text = model.title;
    self.yuanliao.text = model.yuanliao;
    
    if (model.pictureImage == nil) {
        
        [self.pictureView sd_setImageWithURL:[NSURL URLWithString:model.thumb] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
            
            model.pictureImage = image;
            
        }];
        
    }
    
    self.pictureView.image = model.pictureImage;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
